
package br.edu.sistemaacademico.iterator;

import br.edu.sistemaacademico.state.State;
import br.edu.sistemaacademico.util.Vetor;

import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Vector;

import javax.swing.JComponent;

public class PermissoesComponentes {

    private List<JComponent> componentesCliente = new LinkedList<JComponent>();
    private List<JComponent> componentesProfessor = new LinkedList<JComponent>();
    private List<JComponent> componentesServidor = new LinkedList<JComponent>();
    Vetor vetor = new Vetor();
    
    public void addComponenteCliente(JComponent jc){
        componentesCliente.add(jc);
    }

    public void addComponenteProfessor(JComponent jc){
        componentesProfessor.add(jc);
    }

        public void addComponenteServidor(JComponent jc){
        componentesServidor.add(jc);
    }

    public void setPermissaoCliente(State state){
        for (Iterator it = componentesCliente.iterator(); it.hasNext(); ) {
         //   state.handler((JComponent) componentesCliente);
            //it.next();
        }
    }
    public void setPermissaoProfessor(State state){
        for (Iterator it = componentesProfessor.iterator(); it.hasNext(); ) {
        //    state.handler((JComponent) componentesProfessor);
            //it.next();
        }
    }
    public void setPermissaoServidor(State state){
        for (Iterator it = componentesServidor.iterator(); it.hasNext(); ) {
     //       state.handler((JComponent) componentesServidor);
            //it.next();
        }
    }
    
    public void teste(){
        br.edu.sistemaacademico.iterator.Iterator it = vetor.createIterator();
        for (Object o = it.first(); !it.isDone(); o = it.next()) {
            System.out.println(o);
        }
    }
}
